package com.itheima.chapter01.array;
/*
    遍历数组
 */
public class demo1 {
    public static void main(String[] args) {
        int[] arr=new int[6];//动态初始化
        arr[0]=12;
        arr[1]=22;
        arr[2]=23;
        arr[3]=31;
        arr[4]=36;
        arr[5]=45;
        for (int i = 0; i < arr.length; i++) {
            System.out.println("数组中第"+(i+1)+"数据是"+arr[i]);
        }
        System.out.println("--------------------");
        int[] array={23,56,78,89,96,34,52};//静态初始化
        for (int i = 0; i < array.length; i++) {
            System.out.println("数组中第"+(i+1)+"数据是"+array[i]);
        }
    }
}
